package stringexercise;
/**
 * boolean startsWith(String s):
 * 判断当前字符串是不是以给定的字符串（s）开始的
 *  boolean endsWith(String s):
 *  * 判断当前字符串是不是以给定的字符串（s）结束的
 */
public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        boolean a = str.startsWith("th");
        boolean b = str.startsWith("sh");
        boolean c = str.endsWith("java");
        boolean d = str.endsWith("v");
        System.out.println(a);//t
        System.out.println(b);//f
        System.out.println(c);//t
        System.out.println(d);//f
    }
}
